package com.bw.liuyushan.zhuangao4_mvptest1.Utils;

import com.bw.liuyushan.zhuangao4_mvptest1.BaseUrl.APIUser;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * ZhuanGao4_MVPTest1
 * file name is : UserManager
 * created by Ender on 2021/8/19 14:30.
 * author : 刘雨杉
 * Describe(作用):
 */
public class UserManager {
    private static UserManager userManager;

    public static UserManager getInstance() {
        if (userManager == null) {
            synchronized (UserManager.class) {
                if (userManager == null) {
                    userManager = new UserManager();
                }
            }
        }
        return userManager;
    }

    public Retrofit getLogin() {
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(APIUser.url)
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .addConverterFactory(GsonConverterFactory.create())
                .build();
        return retrofit;
    }
}
